import { http } from "@/utils/http";

/**
 * rtcm分组
 */
export interface RtcmGroupDTO {
  /**
   * ntrip分组名称
   */
  groupName: string;
  id?: number;
  flag?: boolean;
}

export type RtcmGroupList = Array<RtcmGroupDTO>;

/**
 * 查询rtcm参数
 */
export interface RtcmGroupParams {
  pageSize: number;
  pageNum: number;
  name?: string;
}

/**
 * 查询分组
 */
export const getRtcmGroupApi = (params: RtcmGroupParams) => {
  return http.request<any>("get", "/rtcmGroup", {
    params
  });
};

/**
 * 添加rtcm分组
 */
export const addRtcmGroupApi = (data: RtcmGroupDTO) => {
  return http.request<any>("post", "/rtcmGroup", {
    data
  });
};
/**
 * 删除分组
 */
export const deleteRtcmGroupApi = (id: number) => {
  return http.request<any>("delete", `/rtcmGroup/${id}`);
};

/**
 * 修改分组
 */
export const updateRtcmGroupApi = (data: RtcmGroupDTO) => {
  return http.request<any>("put", "/rtcmGroup", {
    data
  });
};
